﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using lakethaiClassLibrary;

public partial class home_article : BasePage
{
    protected string title = string.Empty, description = string.Empty,
        details = string.Empty;
    protected string photoURL = @"../images/nophoto.gif";
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = Resources.header.newsTitle;
        this.BindingData();
    }
    private void BindingData()
    {
        string lang = HttpContext.Current.Session["lancode"].ToString();
        int id = 0;
        try
        {
            id = int.Parse(Request.QueryString["articleID"]);
        }
        catch {}
        if (id == 0) return;
        SqlParameter[] param ={new SqlParameter("articleID",id),
                                 new SqlParameter("lang",lang)};
        DataTable dt = myDataBinding.GetData("_articleGetItemForShow", param);
        try
        {
            DataRow row = dt.Rows[0];
            this.photoURL = row[1].ToString();
            this.title = row[2].ToString();
            this.description = row[3].ToString();
            this.details = row[4].ToString();
        }
        catch {}
    }
}
